<template>
	<s-layout title="店铺列表" navbar="custom" :showLeftButton="true" navbarMode="normal"
		:bgStyle="template.style?.background" :navbarStyle="template.style?.navbar" onShareAppMessage
		:showFloatButton="true">
		<view>
			<!-- header start -->
			<view>
				<swiper mode="rect" style="height: 600rpx;" border-radius="0">
					<swiper-item v-for="(it,idx) in bannerList" style="height: 600rpx;" :key="idx"
						@tap="clickBanner(it)">
						<image style="width: 100vw;height: 600rpx;" :src="it" class="img" />
					</swiper-item>
				</swiper>
			</view>

			<view class="body">
				<view class="flex">
					<view>
						<image :src="storeInfo.logo" style="width: 200rpx;height: 200rpx;"></image>
					</view>
					<view style="color: #999798;">
						<view style="color: #000;font-weight: bold;font-size: 35rpx;margin-bottom: 20rpx;">
							{{ storeInfo.shopName }}</view>
						<view>营业时间：{{ storeInfo.businessHours }}</view>
						<view>备注：{{ storeInfo.remark || '-' }}</view>
					</view>
				</view>
				<view class="flex" style="padding: 20rpx;background-color: #f5f5f5;height: 90rpx;">
					<view style="color: #959595 ;width: 400rpx;font-size: 28rpx;">{{ storeInfo.address }}</view>
					<view class="line"></view>
					<view style="color: #9d9d9d;margin-left: 20rpx;" @click="goNav()">
						<view><uni-icons type="paperplane" color="#b2b2b2" size="30"></uni-icons></view>
						<view>导航</view>
					</view>
					<view v-if="this.storeInfo.contactPhone" style="margin-left: 35rpx;" @click="makePhoneCall()">
						<view><uni-icons type="phone" color="#b2b2b2" size="30"></uni-icons></view>
						<view style="color: #9d9d9d;">电话</view>
					</view>
				</view>
			</view>
			<!-- body end -->

		</view>
	</s-layout>

</template>

<script>
	import sheep from '@/sheep';
	export default {
		data() {
			return {
				// bannerlist
				bannerList: [
					'https://ihuanggang-live-1323882773.cos.ap-nanjing.myqcloud.com//image/2025/03/08/be84d1f1274b464c94da327310474d47.jpg',
					'https://ihuanggang-live-1323882773.cos.ap-nanjing.myqcloud.com//image/2025/03/08/93d1d6c99bde4529b7e64d04a52ff6ac.jpg'
				],
				storeInfo: {}
			}
		},
		computed: {
			template() {
				return sheep.$store('app').template.user
			}
		},
		onLoad(option) {
			this.storeInfo = JSON.parse(decodeURIComponent(option.params))
		},
		methods: {
			makePhoneCall() {
				uni.makePhoneCall({
					phoneNumber: this.storeInfo.contactPhone //仅为示例
				});
			},
			goNav() {
				uni.openLocation({
					latitude: this.storeInfo.latitude, //纬度
					longitude: this.storeInfo.longitude, //经度
					address: this.storeInfo.address
				});
			}

		}
	}
</script>

<style lang="scss" scoped>
	.body {
		position: relative;
		z-index: 99999;
		margin: -40rpx 30rpx 0 30rpx;
		padding: 20rpx 15rpx;
		background-color: white;
		border-radius: 14rpx;
		padding-bottom: 20rpx;
		background-color: #fff;

		.line {
			height: 60rpx;
			width: 2rpx;
			background-color: #cdcdcd;
			// margin-top: 10rpx;
			margin: 10rpx 20rpx;
		}

		&__text {
			font-weight: bold;
			font-size: 30rpx;
			margin-top: 15rpx;
		}
	}

	.integral {
		display: flex;
		align-items: flex-end;
		padding: 20rpx;

		&__nav {
			// color: $u-main-color;
			font-weight: bold;
			margin-bottom: 20rpx;
			font-size: 30rpx;

			text {
				font-size: 38rpx;
			}
		}

		&__desc {
			font-size: 24rpx;
			// color: $u-type-info;
			margin-bottom: 10rpx;
		}
	}

	.grid-text {
		font-size: 38rpx;
		font-weight: bold;
	}

	.grid-desc {
		font-size: 24rpx;
		// color: $u-type-info;
		margin-bottom: 30rpx;
	}
</style>